﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Transactions;
using System.Web;
using System.Web.Mvc;
using System.Web.Security; 
using ITXHWEB.Models;
using System.Xml.Linq;
using WPFExcelReport;
namespace ITXHWEB.Controllers
{ 
    public partial class AccountController
    {

        [AllowAnonymous]
        public ActionResult GetID(string returnUrl)
        {
            ViewBag.ReturnUrl = returnUrl;
            LoginModel model = new LoginModel();
            if (!app.IsOnline)
            {
                app.GetID();
            }
            model.AGENTID = app.AgentID;
            model.IsLogIn = false;
            model.UserName = "sun";
            return View(model);
        }

        //
        // POST: /Account/Login

        [HttpPost]
        [AllowAnonymous]
        [ValidateAntiForgeryToken]
        public ActionResult GetID(LoginModel model, string returnUrl)
        {
            if (!app.IsOnline)
            {
                app.GetID();
            }
            model.AGENTID = app.AgentID;
            //model.IsLogIn = IsLogOn;
            app.User = model.UserName;
            ModelState.Clear();
            View(model);
            if (model.IsLogIn)
            {
                return RedirectToLocal(returnUrl);
            }
            return View(model);
        }
        //
        // POST: /Account/LogOff
       
    }
}
